#!/usr/bin/env python
# Copyright (C) 2007 by Xyhthyx <xyhthyx@gmail.com>

# This file is part of Parcelle.

# Parcelle is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.

# Parcelle is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

import os

# This file contains some constants that are
# shared throughout the entire program

# GUI path
if os.path.exists(os.path.abspath('../gui/')):
	GUI_PATH = os.path.abspath('../gui/')
else:
	GUI_PATH = '/usr/share/parcelle/gui'

# Main window constants
MAIN_GLADE_FILE = os.path.join(GUI_PATH, 'parcelle.glade')
MAIN_FORM_NAME = 'WindowMain'

# Preferences window constants
PREF_GLADE_FILE = os.path.join(GUI_PATH, 'preferences.glade')
PREF_FORM_NAME = 'frmPreferences'

# About dialog constants
ABOUT_GLADE_FILE = os.path.join(GUI_PATH, 'about.glade')
ABOUT_FORM_NAME = 'AboutDialog'

# Settings files constants
# FIXME: Possibly replace with os.path.expanduser('~')
#        to get home folder
if os.path.exists(os.path.join(os.environ['HOME'], '.parcelle')):
	SETTINGS_FOLDER = os.path.join(os.environ['HOME'], '.parcelle')
else:
	os.mkdir(os.path.join(os.environ['HOME'], '.parcelle'))
	SETTINGS_FOLDER = os.path.join(os.environ['HOME'], '.parcelle')

PARCELLE_FILE = os.path.join(SETTINGS_FOLDER, 'parcelle.xml')
START_FILE = os.path.join(SETTINGS_FOLDER, 'parcelle.start')
RECENT_FILE = os.path.join(SETTINGS_FOLDER, 'recent.xml')

# Delete two useless variables
del GUI_PATH
del SETTINGS_FOLDER
